package cn.example;

import cn.example.pojo.Employee;
import cn.example.pojo.SysRole;
import cn.example.service.SysRoleService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ImportResource;

import java.util.List;

@SpringBootApplication
@ImportResource("classpath:applicationContext.xml")
@MapperScan("cn.example.mapper")
public class JspdemoApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(JspdemoApplication.class, args);
        /*System.out.println(run.getBean("sysUser"));*/
        /*Employee bean = run.getBean(Employee.class);
        System.out.println(bean);*/

        SysRoleService bean = run.getBean(SysRoleService.class);
        List<SysRole> sysRole = bean.getSysRole();
        System.out.println(sysRole);

    }

}
